import request from '@/utils/http'

// 获取轮播图列表
export const getGoodsListAPI = (data) => {
  return request({
    url: 'goods/list',
    method: 'post',
    data
  })
}

// 新增轮播图
export const addGoods = (data) => {
  return request({
    url: '/goods',
    method: 'post',
    data
  })
}

// 修改轮播图
export const updateBanner = (data) => {
  return request({
    url: '/goods',
    method: 'PUT',
    data
  })
}

// 删除轮播图
export const deleteBanner = (id) => {
  return request({
    url: `/goods/${id}`,
    method: 'DELETE'
  })
}

// 查询标签列表
export const getTagList = () => {
  return request({
    url: '/tags'
  })
}
// 新增标签
export const addTag = (data) => {
  return request({
    url: '/tags',
    method: 'post',
    data
  })
}
// 修改标签
export const updateTag = (data) => {
  return request({
    url: '/tags',
    method: 'PUT',
    data
  })
}
// 删除标签
export const deleteindex = (id) => {
  return request({
    url: `/goods/${id}`,
    method: 'DELETE'
  })
}
